In people's daily life, when a network is used for querying data or information, generally a result cached by using a domain name system (DNS) technology is received. However, a DNS cached result is time-sensitive, namely a response result is unchanged within valid time. Therefore, the DNS cached result may be stored in a cache memory of a server device so that the DNS cached result may be returned to a result of a client request within extremely short time. After the valid time expires, a system may query the domain name from an external network and update a result into the cache memory.
In the prior art, generally by using a read-write lock, visitors of shared resources are divided into readers and writers. The readers merely carry out read access on the shared resources, whereas the writers need to carry out a write operation on the shared resources. In the prior art, when writing cache, a read cache thread cannot read data, which may cause wait of the thread. Therefore, in the prior art, different domain name cache information affects each other. Updating information of one domain name may cause other domain name information unable to be read. When a large number of update operations exist, a long time delay of a read operation may be caused if the prior art is used, thereby greatly reducing a response speed.
Additionally, in the prior art, cache update is not smart. In the prior art, it is determined whether to update a cache merely according to valid time, automatic cache management is unavailable to a domain name having many special requirements, and it is impossible to better improve a quality in granting a request
In conclusion, in the prior art, when cache information is processed, there are problems of thread wait and a corresponding speed decreased due to mutual influence of different cache information and problems of not smart in updating cache information and low in quality of cache information due to absence of a preliminary update function or an update control strategy, and a case of too many updates may likely happen at the same time, thereby having a negative effect on users' normal visits.